package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

class zbat {
   private zn a;
   private com.aspose.cells.b.a.b.zq b;
   private zbak c;
   private com.aspose.cells.b.a.b.zg d;
   private float e;
   private float f;
   private float g;
   private ArrayList h;
   private int i;
   private static final com.aspose.cells.b.c.a.za j = new com.aspose.cells.b.c.a.za(new String[]{"Bold", "加粗", "Italic", "倾斜", "Regular", "常规"});

   public int a() {
      return this.i;
   }

   public void a(int var1) {
      this.i = var1;
   }

   public zbat(com.aspose.cells.b.a.b.zq var1, zbak var2, ArrayList var3, com.aspose.cells.b.a.b.zg var4) {
      this(var1, var2, var3, var4, 1.0F, 1.0F);
   }

   public zbat(com.aspose.cells.b.a.b.zq var1, zbak var2, ArrayList var3, com.aspose.cells.b.a.b.zg var4, float var5, float var6) {
      this.i = 0;
      this.b = var1;
      this.c = var2;
      this.h = var3;
      this.d = var4;
      this.f = var5;
      this.g = var6;
   }

   public void a(zn var1, float var2) {
      this.a = var1;
      this.e = this.a.a("A", this.d).c() * this.g;
      if (this.b()) {
         if (this.h != null && this.h.size() > 0) {
            com.aspose.cells.b.a.b.zv var3 = new com.aspose.cells.b.a.b.zv();
            var3.a(this.c.a());
            var3.c(this.c.b());
            this.a(this.h);
            if (this.c.b() == 0) {
               if (this.c.c()) {
                  this.c(this.h);
                  this.e(this.h);
                  this.f(this.h);
               } else if (this.c.d()) {
                  this.c(this.h);
                  this.d(this.h);
                  this.f(this.h);
               } else if (this.c.a() == 0) {
                  this.c(this.h);
                  this.f(this.h);
               } else if (this.c.a() == 1) {
                  this.c(this.h);
                  this.a(this.h, true);
                  this.f(this.h);
               } else {
                  this.c(this.h);
                  this.a(this.h, false);
                  this.f(this.h);
               }
            } else if (this.c.b() == 2) {
               if (this.c.c()) {
                  this.c(this.h);
                  this.e(this.h);
                  this.b(this.h, false);
                  this.f(this.h);
               } else if (this.c.d()) {
                  this.c(this.h);
                  this.d(this.h);
                  this.b(this.h, false);
                  this.f(this.h);
               } else if (this.c.a() == 0) {
                  this.c(this.h);
                  this.b(this.h, false);
                  this.f(this.h);
               } else if (this.c.a() == 1) {
                  this.c(this.h);
                  this.a(this.h, true);
                  this.b(this.h, false);
                  this.f(this.h);
               } else {
                  this.c(this.h);
                  this.a(this.h, false);
                  this.b(this.h, false);
                  this.f(this.h);
               }
            } else if (this.c.c()) {
               this.c(this.h);
               this.e(this.h);
               this.b(this.h, true);
               this.f(this.h);
            } else if (this.c.d()) {
               this.c(this.h);
               this.d(this.h);
               this.b(this.h, true);
               this.f(this.h);
            } else if (this.c.a() == 0) {
               this.c(this.h);
               this.b(this.h, true);
               this.f(this.h);
            } else if (this.c.a() == 1) {
               this.c(this.h);
               this.a(this.h, true);
               this.b(this.h, true);
               this.f(this.h);
            } else {
               this.c(this.h);
               this.a(this.h, false);
               this.b(this.h, true);
               this.f(this.h);
            }

            com.aspose.cells.b.a.b.zo var4 = new com.aspose.cells.b.a.b.zo(this.b.j() + this.b.h() / 2.0F, this.b.k() + this.b.i() / 2.0F);
            if (var2 != 0.0F) {
               this.a.b(var4.d(), var4.e());
               this.a.a(var2);
            }

            Iterator var5 = this.h.iterator();

            while(var5.hasNext()) {
               zbao var6 = (zbao)var5.next();
               if (var6.b == 2) {
                  com.aspose.cells.b.a.b.zg var7 = var6.c();
                  int var8 = this.a(var7);
                  float var9 = (float)(var8 * var7.b().c(var7.k()) / var7.b().e(var7.k()));
                  float var10 = (float)(var8 * var7.b().d(var7.k()) / var7.b().e(var7.k()));
                  float var11 = (float)(var8 * var7.b().f(var7.k()) / var7.b().e(var7.k()));
                  com.aspose.cells.b.a.b.zv var12 = new com.aspose.cells.b.a.b.zv(com.aspose.cells.b.a.b.zv.c());
                  com.aspose.cells.b.a.b.zo var13 = new com.aspose.cells.b.a.b.zo(var6.a.d().d(), var6.a.d().e());
                  if (this.a(var6)) {
                     if (var2 != 0.0F) {
                        var13.a(var13.d() - var4.d());
                        var13.b(var13.e() - var4.e());
                     }

                     this.a.a(var6.b(), var6.c(), new com.aspose.cells.b.a.b.zu(var6.d()), (com.aspose.cells.b.a.b.zo)var13, var12);
                  }
               }
            }

            if (var2 != 0.0F) {
               this.a.d();
            }

         }
      }
   }

   private boolean a(zbao var1) {
      if (this.a() == 2) {
         return true;
      } else if (var1.a.f() < this.b.f() - 4.0F) {
         return false;
      } else if (var1.a.g() < this.b.g() - 4.0F) {
         return false;
      } else if (var1.a.l() > this.b.l() + 4.0F) {
         return false;
      } else {
         return var1.a.m() <= this.b.m() + 4.0F;
      }
   }

   private boolean b() {
      return this.b.h() > 0.0F && this.b.i() > 0.0F;
   }

   private void a(ArrayList var1) {
      com.aspose.cells.b.a.g.a.ze var2 = new com.aspose.cells.b.a.g.a.ze("\\n");

      zbao var7;
      for(int var3 = 0; var3 < var1.size(); ++var3) {
         zbao var4 = (zbao)var1.get(var3);
         String[] var5 = var2.c(var4.b());
         if (var5.length > 1) {
            for(int var6 = 0; var6 < var5.length; ++var6) {
               if (!"".equals(var5[var6])) {
                  var7 = new zbao(var5[var6], var4.c(), var4.d(), 2, var4.a());
                  var1.add(var3, var7);
                  ++var3;
               } else if ("".equals(var5[var6]) && var6 == var5.length - 1) {
                  break;
               }

               if (var6 != var5.length - 1) {
                  var7 = new zbao("", var4.c(), var4.d(), 0, var4.a());
                  var1.add(var3, var7);
                  ++var3;
               }
            }

            var1.remove(var3);
            --var3;
         }
      }

      com.aspose.cells.b.a.g.a.ze var12 = new com.aspose.cells.b.a.g.a.ze("(\\s){1,}");

      for(int var11 = 0; var11 < var1.size(); ++var11) {
         zbao var13 = (zbao)var1.get(var11);
         com.aspose.cells.b.a.g.a.zd var15 = var12.b(var13.b());
         if (var15.a() > 0) {
            int var8 = 0;

            for(int var9 = 0; var9 < var15.a(); ++var9) {
               String var10;
               if (var15.a(var9).d() > var8) {
                  var10 = var13.b().substring(var8, var8 + (var15.a(var9).d() - var8));
                  var7 = new zbao(var10, var13.c(), var13.d(), 2, var13.a());
                  var1.add(var11, var7);
                  ++var11;
               }

               var7 = new zbao(var15.a(var9).a(), var13.c(), var13.d(), 1, var13.a());
               var1.add(var11, var7);
               ++var11;
               var8 = var15.a(var9).d() + var15.a(var9).a().length();
               if (var9 == var15.a() - 1 && var8 <= var13.b().length() - 1) {
                  var10 = var13.b().substring(var8, var8 + (var13.b().length() - var8));
                  var7 = new zbao(var10, var13.c(), var13.d(), 2, var13.a());
                  var1.add(var11, var7);
                  ++var11;
               }
            }

            var1.remove(var11);
            --var11;
         }
      }

      this.b(var1);
      com.aspose.cells.b.a.b.zv var16 = new com.aspose.cells.b.a.b.zv();
      var16.b(2048);

      for(int var14 = 0; var14 < var1.size(); ++var14) {
         zbao var17 = (zbao)var1.get(var14);
         com.aspose.cells.b.a.b.zt var18;
         if (var17.b != 0) {
            var18 = this.a(var17.b(), var17.c());
            var18.a(var18.b() * this.f);
            var18.b(var18.c() * this.g);
            var17.c = var18;
         } else {
            var18 = this.a("A", var17.c());
            var18.a(var18.b() * this.f);
            var18.b(var18.c() * this.g);
            var17.c = var18;
         }
      }

   }

   private void b(ArrayList var1) {
      for(int var2 = 0; var2 < var1.size(); ++var2) {
         zbao var3 = (zbao)var1.get(var2);
         if (var3.b == 2) {
            ArrayList var4 = zgd.a(var3.b());
            if (var4.size() > 1) {
               for(int var5 = 0; var5 < var4.size(); ++var5) {
                  zbao var6 = new zbao((String)var4.get(var5), var3.c(), var3.d(), 2, var3.a());
                  var1.add(var2, var6);
                  ++var2;
               }

               var1.remove(var2);
               --var2;
            }
         }
      }

   }

   private String[] a(String var1, float var2, com.aspose.cells.b.a.b.zg var3) {
      if (var1 != null && var1.length() >= 1) {
         String[] var4 = new String[2];
         if (var1.length() == 1) {
            return new String[]{var1, ""};
         } else {
            for(int var5 = 1; var5 <= var1.length(); ++var5) {
               String var6 = var1.substring(0, 0 + var5);
               com.aspose.cells.b.a.b.zt var7 = this.a(var6, var3);
               if (var7.b() > var2) {
                  var4[0] = var1.substring(0, 0 + (var5 - 1));
                  var4[1] = var1.substring(var5 - 1);
                  break;
               }
            }

            return var4;
         }
      } else {
         return new String[]{"", ""};
      }
   }

   private com.aspose.cells.b.a.b.zt a(String var1, com.aspose.cells.b.a.b.zg var2) {
      com.aspose.cells.b.a.b.zt var3 = zbuk.a(this.a, var1, var2, new com.aspose.cells.b.a.b.zt(2.14748365E9F, 2.14748365E9F));
      return var3;
   }

   private void c(ArrayList var1) {
      com.aspose.cells.b.a.b.zo var2 = this.b.d();
      float var3 = -3.4028235E38F;

      for(int var4 = 0; var4 < var1.size(); ++var4) {
         zbao var5 = (zbao)var1.get(var4);
         float var6 = this.b.l() - var2.d();
         if (var5.b == 0) {
            var5.a = new com.aspose.cells.b.a.b.zq(this.b.f(), var2.e(), this.b.h(), var5.c.c());
            var2.a(this.b.d().d());
            var2.b(var2.e() + (var3 == -3.4028235E38F ? var5.c.c() : var3));
            var3 = -3.4028235E38F;
         } else if (var5.b == 1) {
            if (var5.c.b() < var6) {
               var5.a.a(var2);
               var5.a.a(var5.c);
               var2.a(var2.d() + var5.c.b());
            } else if (var6 != 0.0F) {
               var5.c.a(var6);
               var5.a.a(var2);
               var5.a.a(var5.c);
               var2.a(this.b.f());
               var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
               var3 = -3.4028235E38F;
            } else {
               var5.c.a(var6);
               var5.a.a(var2);
               var5.a.a(var5.c);
               var2.a(this.b.f());
               var3 = -3.4028235E38F;
            }
         } else if (var5.b == 2) {
            zbao var7 = null;
            zbao var8 = null;
            if (var4 > 0) {
               var7 = (zbao)var1.get(var4 - 1);
            }

            if (var4 + 1 < var1.size()) {
               var8 = (zbao)var1.get(var4 + 1);
            }

            String[] var9;
            zbao var10;
            if (var7 != null && var7.b == 1) {
               if (var5.c.b() > var6) {
                  var2.a(this.b.f());
                  var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
                  var3 = var5.c.c();
                  var6 = this.b.l() - var2.d();
                  if (var5.c.b() < var6) {
                     var5.a.a(var2);
                     var5.a.a(var5.c);
                     var2.a(var2.d() + var5.c.b());
                  } else if (var5.c.b() == var6) {
                     var5.a.a(var2);
                     var5.a.a(var5.c);
                     var2.a(this.b.f());
                     var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
                     var3 = -3.4028235E38F;
                  } else {
                     var9 = this.a(var5.b(), var6, var5.c());
                     if (var9.length != 2 || !"".equals(var9[0]) || !var9[1].equals(var5.b())) {
                        var10 = new zbao(var9[0], var5.c(), var5.d(), 2, var5.a());
                        var10.a = new com.aspose.cells.b.a.b.zq(var2, new com.aspose.cells.b.a.b.zt(var6, var5.c.c()));
                        var10.c = var10.a.e();
                        var1.add(var4, var10);
                        var5.a(var9[1]);
                        var5.c = this.a(var5.b(), var5.c());
                        if (var3 < var5.c.c()) {
                           var3 = var5.c.c();
                        }

                        var2.a(this.b.f());
                        var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
                        var3 = -3.4028235E38F;
                     }
                  }
               } else {
                  float var13 = var5.c.b();

                  int var14;
                  for(var14 = var4 + 1; var14 < var1.size() && var8.b == 2; ++var14) {
                     var8 = (zbao)var1.get(var14);
                     if (var8.b != 2 || this.a(var8.b())) {
                        break;
                     }

                     var13 += var8.c.b();
                     if (var13 > var6) {
                        break;
                     }
                  }

                  if (var13 < var6) {
                     while(var4 < var14) {
                        var8 = (zbao)var1.get(var4);
                        var8.a.a(var2);
                        var8.a.a(var8.c);
                        if (var3 < var8.c.c()) {
                           var3 = var8.c.c();
                        }

                        var2.a(var2.d() + var8.c.b());
                        ++var4;
                     }

                     --var4;
                  } else if (var13 != var6) {
                     if (var2.d() == this.b.f()) {
                        while(var4 < var14) {
                           var8 = (zbao)var1.get(var4);
                           var6 -= var8.c.b();
                           if (var6 < 0.0F) {
                              if (var2.d() != this.b.f()) {
                                 var2.a(this.b.f());
                                 var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
                                 var3 = -3.4028235E38F;
                                 break;
                              }

                              String[] var11 = this.a(var8.b(), this.b.h(), var8.c());
                              zbao var12 = new zbao(var11[0], var8.c(), var8.d(), 2, var5.a());
                              var12.a = new com.aspose.cells.b.a.b.zq(var2, new com.aspose.cells.b.a.b.zt(var6, var8.c.c()));
                              var12.c = var12.a.e();
                              var1.add(var4, var12);
                              var8.a(var11[1]);
                              var8.c = this.a(var8.b(), var8.c());
                              if (var3 < var8.c.c()) {
                                 var3 = var8.c.c();
                              }

                              var2.a(this.b.f());
                              var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
                              var3 = -3.4028235E38F;
                           }

                           var8.a.a(var2);
                           var8.a.a(var8.c);
                           if (var3 < var8.c.c()) {
                              var3 = var8.c.c();
                           }

                           var2.a(var2.d() + var8.c.b());
                           ++var4;
                        }
                     } else {
                        var2.a(this.b.f());
                        var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
                        var3 = -3.4028235E38F;
                        --var4;
                     }
                  } else {
                     while(var4 < var14) {
                        var8 = (zbao)var1.get(var4);
                        var8.a.a(var2);
                        var8.a.a(var8.c);
                        if (var3 < var8.c.c()) {
                           var3 = var8.c.c();
                        }

                        var2.a(var2.d() + var8.c.b());
                        ++var4;
                     }

                     --var4;
                     var2.b(var2.e() + var8.c.c());
                     var3 = -3.4028235E38F;
                  }
               }
            } else if (var5.c.b() < var6) {
               var5.a.a(var2);
               var5.a.a(var5.c);
               if (var3 < var5.c.c()) {
                  var3 = var5.c.c();
               }

               var2.a(var2.d() + var5.c.b());
            } else if (var5.c.b() == var6) {
               var5.a.a(var2);
               var5.a.a(var5.c);
               if (var3 < var5.c.c()) {
                  var3 = var5.c.c();
               }

               var2.a(var2.d() + var5.c.b());
               var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
               var3 = -3.4028235E38F;
            } else {
               var9 = this.a(var5.b(), var6, var5.c());
               var10 = new zbao(var9[0], var5.c(), var5.d(), 2, var5.a());
               var10.a = new com.aspose.cells.b.a.b.zq(var2, new com.aspose.cells.b.a.b.zt(var6, var5.c.c()));
               var10.c = var10.a.e();
               var1.add(var4, var10);
               var5.a(var9[1]);
               var5.c = this.a(var5.b(), var5.c());
               if (var3 < var5.c.c()) {
                  var3 = var5.c.c();
               }

               var2.a(this.b.f());
               var2.b(var2.e() + (var3 == -3.4028235E38F ? this.e : var3));
               var3 = -3.4028235E38F;
            }
         }
      }

      this.g(var1);
   }

   private void a(ArrayList var1, boolean var2) {
      int var3 = 0;
      float var4 = Float.MAX_VALUE;
      float var5 = 0.0F;

      int var6;
      zbao var7;
      for(var6 = 0; var6 < var1.size(); ++var6) {
         var7 = (zbao)var1.get(var6);
         if (var7.a() != 7 && var7.b != 0) {
            if (var7.a.g() > var4) {
               for(int var8 = var6 - 1; var8 > var3; --var8) {
                  zbao var9 = (zbao)var1.get(var8);
                  if (var9.b == 2) {
                     break;
                  }

                  if (var9.b == 1) {
                     var5 -= var9.c.b();
                  }
               }

               float var13 = 0.0F;
               if (var2) {
                  var13 = (this.b.h() - var5) / 2.0F;
               } else {
                  var13 = this.b.h() - var5;
               }

               for(int var14 = var3; var14 < var6; ++var14) {
                  zbao var10 = (zbao)var1.get(var14);
                  if (var10.b == 2) {
                     var10.a.a(var10.a.f() + var13);
                  }
               }

               var5 = 0.0F;
               var3 = var6;
            }

            var5 += var7.c.b();
            var4 = var7.a.g();
         }
      }

      for(var6 = var1.size() - 1; var6 > var3; --var6) {
         var7 = (zbao)var1.get(var6);
         if (var7.b == 2) {
            break;
         }

         if (var7.b == 1) {
            var5 -= var7.c.b();
         }
      }

      float var11 = 0.0F;
      if (var2) {
         var11 = (this.b.h() - var5) / 2.0F;
      } else {
         var11 = this.b.h() - var5;
      }

      for(int var12 = var3; var12 < var1.size(); ++var12) {
         zbao var15 = (zbao)var1.get(var12);
         if (var15.a() != 7 && var15.b == 2) {
            var15.a.a(var15.a.f() + var11);
         }
      }

   }

   private void d(ArrayList var1) {
      int var2 = 0;
      float var3 = Float.MAX_VALUE;
      float var4 = 0.0F;
      int var5 = 0;
      boolean var6 = true;

      for(int var7 = 0; var7 < var1.size(); ++var7) {
         zbao var8 = (zbao)var1.get(var7);
         if (var8.b == 0) {
            if (var4 < this.b.h()) {
               var6 = false;
               var4 = 0.0F;
               var5 = 0;
               var2 = var7;
            }
         } else {
            if (var8.a.g() > var3 && var6) {
               int var9;
               zbao var10;
               for(var9 = var7 - 1; var9 > var2; --var9) {
                  var10 = (zbao)var1.get(var9);
                  if (var10.b == 2) {
                     break;
                  }

                  if (var10.b == 1) {
                     var4 -= var10.c.b();
                     --var5;
                  }
               }

               for(var9 = var2; var9 < var7; ++var9) {
                  var10 = (zbao)var1.get(var9);
                  if (var10.b == 2) {
                     break;
                  }

                  if (var10.b == 1) {
                     var4 -= var10.c.b();
                     --var5;
                  }
               }

               float var14 = (this.b.h() - var4) / (float)var5;
               boolean var15 = false;
               float var11 = this.b.f();

               for(int var12 = var2; var12 < var7; ++var12) {
                  zbao var13 = (zbao)var1.get(var12);
                  if (var13.b == 1 && !var15) {
                     var11 += var13.c.b();
                  } else if (var13.b == 2) {
                     if (!var15) {
                        var15 = true;
                     }

                     var13.a.a(var11);
                     var11 += var13.c.b();
                  } else if (var13.b == 1) {
                     var11 += var13.c.b() + var14;
                  }
               }

               var5 = 0;
               var4 = 0.0F;
               var2 = var7;
            }

            if (var4 == 0.0F) {
               var6 = true;
            }

            if (var8.b == 1) {
               ++var5;
            }

            var4 += var8.c.b();
            var3 = var8.a.g();
         }
      }

   }

   private void e(ArrayList var1) {
      int var2 = 0;
      float var3 = Float.MAX_VALUE;
      float var4 = 0.0F;
      int var5 = 0;

      int var6;
      zbao var7;
      float var15;
      for(var6 = 0; var6 < var1.size(); ++var6) {
         var7 = (zbao)var1.get(var6);
         if (var7.b != 0) {
            if (var7.a.g() > var3) {
               int var8;
               zbao var9;
               for(var8 = var6 - 1; var8 > var2; --var8) {
                  var9 = (zbao)var1.get(var8);
                  if (var9.b == 2) {
                     break;
                  }

                  if (var9.b == 1) {
                     var4 -= var9.c.b();
                     --var5;
                  }
               }

               for(var8 = var2; var8 < var6; ++var8) {
                  var9 = (zbao)var1.get(var8);
                  if (var9.b == 2) {
                     break;
                  }

                  if (var9.b == 1) {
                     var4 -= var9.c.b();
                     --var5;
                  }
               }

               var15 = (this.b.h() - var4) / (float)var5;
               boolean var16 = false;
               float var10 = this.b.f();

               for(int var11 = var2; var11 < var6; ++var11) {
                  zbao var12 = (zbao)var1.get(var11);
                  if (var12.b == 1 && !var16) {
                     var10 += var12.c.b();
                  } else if (var12.b == 2) {
                     if (!var16) {
                        var16 = true;
                     }

                     var12.a.a(var10);
                     var10 += var12.c.b();
                  } else if (var12.b == 1) {
                     var10 += var12.c.b() + var15;
                  }
               }

               var5 = 0;
               var4 = 0.0F;
               var2 = var6;
            }

            if (var7.b == 1) {
               ++var5;
            }

            var4 += var7.c.b();
            var3 = var7.a.g();
         }
      }

      for(var6 = var1.size() - 1; var6 > var2; --var6) {
         var7 = (zbao)var1.get(var6);
         if (var7.b == 2) {
            break;
         }

         if (var7.b == 1) {
            var4 -= var7.c.b();
         }
      }

      for(var6 = var2; var6 < var1.size(); ++var6) {
         var7 = (zbao)var1.get(var6);
         if (var7.b == 2) {
            break;
         }

         if (var7.b == 1) {
            var4 -= var7.c.b();
            --var5;
         }
      }

      float var13 = 0.0F;
      var13 = (this.b.h() - var4) / (float)var5;
      boolean var14 = false;
      var15 = this.b.f();

      for(int var17 = var2; var17 < var1.size(); ++var17) {
         zbao var18 = (zbao)var1.get(var17);
         if (var18.b == 1 && !var14) {
            var15 += var18.c.b();
         } else if (var18.b == 2) {
            if (!var14) {
               var14 = true;
            }

            var18.a.a(var15);
            var15 += var18.c.b();
         } else if (var18.b == 1) {
            var15 += var18.c.b() + var13;
         }
      }

   }

   private void f(ArrayList var1) {
      int var2 = 0;
      float var3 = Float.MAX_VALUE;
      float var4 = -3.4028235E38F;
      float var5 = Float.MAX_VALUE;
      zbao var6 = null;

      float var10;
      float var11;
      float var12;
      float var18;
      float var19;
      float var20;
      for(int var7 = 0; var7 < var1.size(); ++var7) {
         zbao var8 = (zbao)var1.get(var7);
         if (var8.b == 2) {
            if (var8.a.g() > var5) {
               if (var3 != var4) {
                  com.aspose.cells.b.a.b.zg var9 = var6.c();
                  var10 = (float)this.a(var9);
                  var11 = var10 * (float)var9.b().c(var9.k()) / (float)var9.b().e(var9.k());
                  var12 = var10 * (float)var9.b().d(var9.k()) / (float)var9.b().e(var9.k());
                  float var13 = var10 * (float)var9.b().f(var9.k()) / (float)var9.b().e(var9.k());
                  float var14 = var13 - var11 - var12;

                  for(int var15 = var2; var15 < var7; ++var15) {
                     zbao var16 = (zbao)var1.get(var15);
                     if (var16.b == 2 && var16 != var6) {
                        com.aspose.cells.b.a.b.zg var17 = var16.c();
                        var18 = (float)this.a(var17);
                        var19 = var18 * (float)var17.b().d(var17.k()) / (float)var17.b().e(var17.k());
                        var20 = var18 * (float)var17.b().c(var17.k()) / (float)var17.b().e(var17.k());
                        float var21 = var18 * (float)var17.b().f(var17.k()) / (float)var17.b().e(var17.k());
                        float var22 = var21 - var20 - var19;
                        var16.a.b(var16.a.g() + (var11 - var20 - var14) * this.g);
                     }
                  }
               }

               var2 = var7;
               var3 = Float.MAX_VALUE;
               var4 = -3.4028235E38F;
            }

            var5 = var8.a.g();
            if (var8.c.c() < var3) {
               var3 = var8.c.c();
            }

            if (var8.c.c() > var4) {
               var4 = var8.c.c();
               var6 = var8;
            }
         }
      }

      if (var3 != var4 && var3 != Float.MAX_VALUE && var4 != -3.4028235E38F && var6 != null) {
         com.aspose.cells.b.a.b.zg var23 = var6.c();
         float var24 = (float)this.a(var23);
         float var25 = var24 * (float)var23.b().c(var23.k()) / (float)var23.b().e(var23.k());
         var10 = var24 * (float)var23.b().d(var23.k()) / (float)var23.b().e(var23.k());
         var11 = var24 * (float)var23.b().f(var23.k()) / (float)var23.b().e(var23.k());
         var12 = var11 - var25 - var10;

         for(int var26 = var2; var26 < var1.size(); ++var26) {
            zbao var27 = (zbao)var1.get(var26);
            if (var27.b == 2 && var27 != var6) {
               com.aspose.cells.b.a.b.zg var28 = var27.c();
               float var29 = (float)this.a(var28);
               float var30 = var29 * (float)var28.b().d(var28.k()) / (float)var28.b().e(var28.k());
               var18 = var29 * (float)var28.b().c(var28.k()) / (float)var28.b().e(var28.k());
               var19 = var29 * (float)var28.b().f(var28.k()) / (float)var28.b().e(var28.k());
               var20 = var19 - var18 - var30;
               var27.a.b(var27.a.g() + (var25 - var18 - var12) * this.g);
            }
         }
      }

   }

   private void b(ArrayList var1, boolean var2) {
      float var3 = -3.4028235E38F;
      float var4 = -3.4028235E38F;
      float var5 = 0.0F;

      zbao var7;
      for(int var6 = var1.size() - 1; var6 >= 0; --var6) {
         var7 = (zbao)var1.get(var6);
         if (var7.b == 0) {
            if (var6 < var1.size() - 1) {
               if (((zbao)var1.get(var6 + 1)).b == 2) {
                  var5 += var3;
               } else {
                  var5 += this.e;
               }
            }

            if (var6 == 0 && !var2) {
               var5 += this.e;
            }

            var3 = -3.4028235E38F;
            var4 = -3.4028235E38F;
         } else if (var7.b == 2) {
            if (var7.a.g() < var4) {
               var5 += var3;
               var3 = -3.4028235E38F;
            }

            var4 = var7.a.g();
            if (var7.c.c() > var3) {
               var3 = var7.c.c();
            }
         } else if (var7.b == 1) {
            ;
         }
      }

      if (var3 != -3.4028235E38F) {
         var5 += var3;
      }

      zbao var8;
      float var9;
      if (var2) {
         var7 = (zbao)var1.get(0);
         var8 = (zbao)var1.get(var1.size() - 1);
         var9 = (this.b.i() - var5) / 2.0F;
      } else {
         var9 = this.b.i() - var5;
      }

      if (var9 < 0.0F && this.a() == 0) {
         var9 = 0.0F;
      }

      for(int var10 = var1.size() - 1; var10 >= 0; --var10) {
         var8 = (zbao)var1.get(var10);
         if (var8.b == 2) {
            var8.a.b(var8.a.g() + var9);
         }
      }

   }

   private void g(ArrayList var1) {
      int var2 = 0;
      float var3 = Float.MAX_VALUE;

      for(int var4 = 0; var4 < var1.size(); ++var4) {
         zbao var5 = (zbao)var1.get(var4);
         if (var5.b != 0) {
            if (var5.a.g() > var3) {
               if (var4 - 1 >= var2) {
                  this.a(var1, var2, var4 - 1);
               }

               var2 = var4;
            }

            var3 = var5.a.g();
         } else {
            if (var4 - 1 >= var2) {
               this.a(var1, var2, var4 - 1);
            }

            var2 = var4 + 1;
            var3 = var5.a.g();
         }
      }

      this.a(var1, var2, var1.size() - 1);
   }

   private void a(ArrayList var1, int var2, int var3) {
      boolean var4 = false;
      String var5 = "";

      for(int var6 = var2; var6 <= var3 && var6 < var1.size(); ++var6) {
         zbao var7 = (zbao)var1.get(var6);
         var5 = var5 + var7.b();
      }

      var4 = zar.b(var5);
      if (var4) {
         float var10 = this.b.j();

         int var11;
         for(var11 = var3; var11 >= var2 && var11 >= 0; --var11) {
            zbao var8 = (zbao)var1.get(var11);
            if (var8.b == 2) {
               break;
            }
         }

         for(int var12 = var11; var12 >= var2 && var12 >= 0; --var12) {
            zbao var9 = (zbao)var1.get(var12);
            var9.a.a(var10);
            var10 += var9.a.h();
         }
      }

   }

   private int a(com.aspose.cells.b.a.b.zg var1) {
      return zbum.a((double)this.a.a().a(var1));
   }

   private boolean a(String var1) {
      if (!"".equals(var1) && !com.aspose.cells.b.a.zv.b(var1, "")) {
         return var1.charAt(0) > 19968 && var1.charAt(0) < '龥';
      } else {
         return false;
      }
   }
}
